1. Field of Invention
The present invention generally relates to a signal processing method, and more particularly, to a method of computing a vector angle by using a coordinate rotation digital computer (CORDIC) and an electronic apparatus using the same.
2. Description of Related Art
Among various signal processing approaches, CORDIC is a very useful means. As a signal processing approach, CORDIC dates back 1959 when Volder firstly published the idea in his paper “The CORDIC Trigonometric Computing Technique” (IRE Transactions on Electronic Computing, EC-8, pp. 330-334). The major operations used in the CORDIC algorithm include addition and shifting. The CORDIC approach is applied in the aviation system field at the beginning, so that a vector rotation and an orientation operation can be done without performing complicate operations such as trigonometric function operation, multiplication operation, radical operation and operation of inverse trigonometric functions.
In recent years, along with the flourishing wireless communication technology, CORDIC has obtained broad application fields: WLAN (wireless local area network), personal WLAN, metropolitan WLAN, digital IC design, and the like. For example, the multi-input multi-output approach in the wireless transmission field is realized by using the CORDIC to perform matrix resolutions.
FIG. 1(A) is a diagram illustrating a conventional CORDIC coordinate rotation mode, where an initial vector (X0, Y0) is rotated by an angle θ (where θ is ranged between −90 degree (−90°) and 90 degree (90°) so that an object vector (X1, Y1) is obtained. There is the following simple relationship between the two vectors:X1=X0 ·cos θ−Y0 sin θ=cos θ(X0−Y0 tan θ)  (1)Y1=Y0·cos θ+X0 sin θ=cos θ(Y0−X0 tan θ)  (2)
Assuming the initial vector takes rotations of n times and then a new vector is obtained, and the rotated angle 6 of each rotation is just an angle corresponding to a tangent value equal to a multiple of 2 (for example, 45° has a tangent value of 20; 26° has a tangent value of 2−1), the rotated angle δ of the 1-th time rotation can be expressed by:δ=arc tan(2−1)  (3)
The corresponding cosine value can be obtained from the formula (3):cos δ=1/√{square root over (1+2−2i)}  (4)
The intermediate vector corresponding to the i-th time rotation can be expressed by:Xi+1=1/√{square root over (1+2−2i)}·(X1−di·Yi·2−i)  (5)Yi+1=1/√{square root over (1+2−2i)}·(Yi+di·Xi·2−1)  (6)
Referring to the relationship between the initial vector and the object vector, in the formulas (5) and (6), di represents the shift unit of the i-th time. Obviously, the intermediate vector can be further simplified as:Xi+1=(Xi−di·Yi·2−i)  (7)Yi+1=(Yi+di·Xi·2−i)  (8)
After the rotations of i times, the relative error between the intermediate vector and the object vector iszi+1=(zi−di·arc tan(2−i))  (9)
Therefore, after the rotations of n times, the initial vector would be coincident with the object vector, that is:Xn=X1=X0·cos θ−Y0·sin θ  (10)Yn=Y1=Y0·cos θ+X0·sin θ  (11)zn=0  (12)An=Πn√{square root over (1+2−2i)}  (13)
where, (Xn, Yn) represents the intermediate vector produced from the initial vector after the rotations of n times; zn represents the relative error between the intermediate vector and the object vector after the rotations of n times; An represents the CORDIC gain value after the rotations of n times.
It should be noted that when θ falls in the second quadrant or the third quadrant (between 90° and 270°), CORDIC needs to perform an rotation first, so that can be controlled to fall in the first quadrant or the fourth quadrant.
FIG. 1(B) is a diagram illustrating a conventional CORDIC coordinate vector mode. In an orthogonal coordinate system, a sampling signal of the initial vector (X0, Y0) is rotated towards the I axis as the object, wherein the coordinates of Q axis thereof need to be minimized. Referring to the depiction of the above-mentioned CORDIC coordinate rotation mode, the relationship between the intermediate vector (Xi,Yi) corresponding to the i-th time rotation and the intermediate vector (Xi+1,Yi+1) corresponding to the (i+1)-th time rotation can be expressed by:Xi+1=(Xi−di·Yi·2−i)  (14)Yi+1=(Yi+di·Xi·2−i)  (15)zi+1=(zi−di·arc tan(2−i))  (16)
wherein di represents the shift unit of the i-th time and zi+1 represents phase error between the intermediate vector and the I axis after the rotations of i times.
FIG. 2 is a diagram of a conventional pipelined CORDIC electronic apparatus. The electronic apparatus includes a plurality of CORDIC sub-modules 200 (respectively including a storage device for saving tangent values 204) and registers 201, 202, and 203. Each CORDIC sub-module 200 receives a set of (xi, yi, zi) of inputs and outputs a set of (xi+1, yi+1, zi+1), wherein i ranges from 0 to n. The CORDIC sub-modules 200 are arranged with a pipelined structure so as to perform an iteration operation. The CORDIC sub-module 200 performs shifting and addition operation. The registers 201˜203 respectively record the outputs of (xi+1, yi+1, zi+1). Since each CORDIC sub-module 200 must contain a storage device for saving tangent values 204 for recording a plurality of tangent values.
FIG. 3 is an arc tangent table used in the conventional CORDIC. Referring to FIG. 2, in the complex coordinates, i represents the times of CORDIC iteration operations. For an initial complex coordinate R, the corresponding phase (the arc tangent of K), a radius and a CORDIC gain value can be respectively obtained according to a specific tangent value K.
FIG. 4 is a schematic graph showing a simulation result for the conventional CORDIC to compute larger angles, where the abscissa axis represents time and the ordinate axis represents the angle degree of the phase error. Under the CORDIC coordinate rotation mode, if the initial phase error is at 44 degree, it needs rotations of 10 times to make the corresponding relative phase error converged. Obviously, the converging speed is too slow and the estimated angle is not accurate, wherein the reason is that no matter a large angle or a small angle to be estimated, the conventional CORDIC needs to repeatedly perform an accumulation operation one after another from a large angle up, and each addend is produced by a power of 2.
The CORDIC algorithm can be referred from the following papers, for example, the paper of Wang, et al “Critically Damped CORDIC Algorithm” (Proceedings of the 37th Midwest Symposium on Circuits and Systems, Lafayette, La., pp. 236-239).
The CORDIC algorithm can be also referred from the paper of Takagi “Studies on Hardware Algorithms for Arithmetic Operations with a Redundant Binary Representation” (Department of Information Science, Faculty of Engineering, University of Kyoto).
The CORDIC algorithm can be further referred from the paper of Timmermann, et al “Low Latency Time CORDIC Algorithms” (IEEE Transactions on Computers, Vol. 41, pp. 1010-1015).